<?php
/**
 * @package Framework
 * @subpackage Controls
 */

/**
 * Creates a menu bar with icons and text underneath it
 * 
 * @package Framework
 * @subpackage Controls
 * 
 * @access public
 */

require_once($GO_CONFIG->class_path.'base/controls/table.class.inc');

class button_menu extends table
{

	var $row;

	function button_menu($id='')
	{
		$this->tagname = 'table';		
		$this->set_linebreak("\n");
		
		if($id != '')
		{
			$this->set_attribute('id', $id);
		}
		
		$this->row = new table_row();

	}
	
	function add_button($image_id, $text, $href, $attributes=array())
	{
		$image = new image($image_id);		
		$image->set_attribute('style', 'border:0px;');
		$hyperlink = new hyperlink($href, $image->get_html().'<br />'.$text);
		$hyperlink->attributes=array_merge($hyperlink->attributes,$attributes);
		$cell = new table_cell($hyperlink->get_html());
		$cell->set_attribute('class', 'ModuleIcons');
		
		$this->row->add_cell($cell);	
	}
	
	function get_html()
	{	
		$this->add_row($this->row);
		return parent::get_html();
	}
	
}
